<?php
/**
 * 分类接口<br />
 * 如：?m=Api/Catalog&tag=article&fid=0.html
 *
 * @author Alen
 * @since 1.0.0 2014-3-22 by sutroon
 * @example ?m=Api/Region&field=province&value=福建省
 */
class CatalogAction extends ApiAction
{
    //put your code here
    public function index(){
        $biz=new SoBizCatalog();
        $tag=  request_string('tag');
        $search='ParentID=0';
        if($tag) $search.=' and ExTags=\''.$tag.'\' ';
        $dataset=$biz->select_arraytreeset($search);
        if(!$dataset) die('没有符合条件的数据!');
        echo str_replace('Name','text',str_replace('ID','id',json_encode($dataset)));
    }
}
